<?php

namespace app\admin\validate;
use think\Validate;

// 错误对照表验证
class ErrorComparisonV extends Validate
{
    //定义验证规则
    protected $rule = [
        'code' => 'require',
        'desc' => 'require|max:70',
        'id'   => 'require|number',
    ];

    //定义验证提示
    protected $message = [
        'code'         => '对照码必填',
        'desc.require' => '描述必填',
        'desc.max'     => '描述最大长度为70字符',
        'id.require'   => '请求参数错误',
        'id.number'    => '请求参数错误',
    ];

    protected $scene = [
        'add'   => ['code','desc'],
        'getid' => ['id'],
        'edit'  => ['id', 'code', 'desc']
    ];
}